<%-- 
    Document   : mailSend
    Created on : 25/03/2013, 02:59:48 PM
    Author     : chus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html><head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manda e-mail</title>

        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/skins/dhtmlxform_dhx_skyblue.css">
        <script src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/dhtmlxcommon.js"></script>
        <script src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/dhtmlxform.js"></script>

    </head>
    <body>
        <div id="myForm" style="height:500px;"></div>
        <script>
            var myForm,
            formData;
          
            formData = [{
                    type: "settings",
                    position: "label-left",
                    labelWidth: 130,
                    inputWidth: 120
                }, {
                    type: "fieldset",
                    label: "Mail",
                    inputWidth: "auto",
                    list: [
                        {
                            type: "input",
                            label: "Para:",
                            name: "para",
                            value: "",
                            required: true
                        }, {
                            type: "input",
                            label: "Asunto",
                            name: "asunto",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label: "mensaje",
                            name: "mensaje",
                            value: "",
                            
                            required: true
                        },{
                            type: "button",
                            name:"guardar",
                            value: "Guardar"
                        }]
                }];
           
            myForm = new dhtmlXForm("myForm", formData);
             myForm.enableLiveValidation(true);
             myForm.attachEvent("onButtonClick", function(id) {
                  if(id=="guardar"){
                      
                     
                  if(myForm.validate()){
                      myForm.send("javamail","get"); 
                  }
     
          }
           })
           
        </script>
    </body>
</html>
